package com.jiyun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiyun.pojo.RiderQueue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-27
 */
@Mapper
public interface RiderQueueMapper extends BaseMapper<RiderQueue> {

    List<RiderQueue> findAll(Integer id);

    void updateDriverId(Integer id, Integer did);

    List<RiderQueue> findAll2(Integer did,Integer id);

    @Update("update rider_queue set order_type=3 where id=#{id}")
    void updateOrderType(Integer id);


    List<RiderQueue> findAll3(Integer id);


    void updateStatus(Integer id);

    void updateStatus2(Integer id);

    void getOneType(Integer did, Integer id);

    void getTwoType(Integer did, Integer id);

    void getThreeType(Integer did, Integer id);

    BigDecimal getList(Integer did, Integer id);

    void driverAddress(String id, String driverLon, String driverLat);

    void saveFees(BigDecimal highwayFee, BigDecimal roadBridgeFee, BigDecimal parkingFee, BigDecimal additionalFee, Integer id);

    @Select("select * from rider_queue where status=#{status}")
    List<RiderQueue> findStatus(Integer status);

    List<RiderQueue> findOne(@Param("id") Integer id);


    String findOrderNumber(Integer id);

    BigDecimal getDriverSumPrive(Integer did);
}
